#include <iostream>
#include <fstream>

using namespace std;

int main() {
    ifstream f_handdle("../CMakeLists.txt", ios::in);
    if (f_handdle)
        cout << "存在文件" << endl;
    else
        cout << "文件不存在" << endl;
    ofstream of_handle("test", ios::out);
    if (of_handle)
        cout << "成功打开文件" << endl;
    else
        cout << "打开文件失败" << endl;
    fstream iof_handle("test", ios::out | ios::in);
    if (iof_handle)
        cout << "读写方式打开文件成功" << endl;
    else
        cout << "读写方式打开文件失败" << endl;
    return 0;
}